package com.dp.factory.service.abstractFactory;

/**
 * <p>Title: 工厂创造器/生成器类</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2018</p>
 * <p>Company: wylCloud.com</p>
 *
 * @author wangyl
 * @version 1.0
 * @date 2020/7/2
 */
public class AbstractFactoryProducer {

    public static final String SHAPE = "SHAPE";

    public static final String COLOR = "COLOR";

    /****
     *
     * @param choice 选择类别
     * @return 工厂类别
     */
    public static AbstractFactory getFactory(String choice) {
        if (SHAPE.equalsIgnoreCase(choice)) {
            return new ShapeFactory();
        } else if (COLOR.equalsIgnoreCase(choice)) {
            return new ColorFactory();
        }
        return null;
    }
}
